package cn.tedu.spring.eg3;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Component
public class ShopController {
    private String shop;

    public ShopController() {
        System.out.println("通过无参构造进行实例化");
    }

    @Value("set")
    public void setShop(String shop) {
        this.shop = shop;
        System.out.println("通过set进行属性赋值");
    }
    @PostConstruct
    public void into() {
        System.out.println("当前进行初始化步骤");
    }

    @PreDestroy
    public void destroy() {
        System.out.println("进行销毁之前的操作，不销毁则不执行");
    }
}
